/*
* 鼠标移入头像，显示用户信息
* */
function show() {
    $(".profile-img").attr("class", "profile-img active");
    $(".user-panel").show();
}

/**
 * 鼠标移出头像，隐藏用户信息
 */
function hide() {
    $(".profile-img").attr("class", "profile-img");
    $(".user-panel").hide();
}

/**
 * 注销登录
 */
function LoginOut() {
    $.ajax({
        url: `${API}/auth/logout`,
        type: "post",
        dataType: "json",
        xhrFields: {withCredentials: true},
        success: function (result) {
            alert("退出登录成功！");
            window.location = "http://www.balabala.xyz/%E4%BC%9A%E5%91%98%E8%B4%AD.html";
        }
    });
}

/**
 * 检查是否阅读用户协议
 */
function checkState() {
    $('.check-icon').change(function () {
        if ($(this).is(":checked")) {
            $('#div3').attr('class', 'confirm-paybtn active');
        } else {
            $('#div3').attr('class', 'confirm-paybtn');
        }
    })
}

/**
 * 弹出二维码
 */
function displayAliPay() {
    $('.pay-shadow').attr('style','display: block')
}

/**
 * 关闭二维码
 */
function offAliPay() {
    $('.pay-shadow').attr('style','display: none')
}